﻿using System;

namespace jsonar
{
	public sealed class Int : Json
    {
        public readonly static Int Zero = new Int(0);
        public readonly static Int One = new Int(1);
        public readonly static Int Two = new Int(2);
        public readonly static Int Three = new Int(3);
        public readonly static Int Four = new Int(4);
        public readonly static Int Five = new Int(5);
        public readonly static Int Six = new Int(6);
        public readonly static Int Seven = new Int(7);
        public readonly static Int Eight = new Int(8);
        public readonly static Int Nine = new Int(9);
        public readonly static Int _One = new Int(-1);

        public int Val() { return this.val; }
		private int val = 0;

		public Int(int num) { this.val = num; }

		public override int getValue(int dft) { return this.val; }
		public override uint getValue(uint dft) { try { return (uint)this.val; } catch { return dft; } }
		public override long getValue(long dft) { return this.val; }
		public override float getValue(float dft) { return this.val; }
		public override double getValue(double dft) { return this.val; }
		public override decimal getValue(decimal dft) { return this.val; }
		public override bool getValue(bool dft) { if (this.val == 1) return true; if (this.val == 0) return false; return dft; }
		public override string getValue(string dft) { return this.val.ToString(); }

		public override string ToString() { return this.val.ToString(); }
	}
}
